import http from "@/api/axios";
import { BusinessType } from "@/api/moduleConfig";
export const getListApi = (data: DepositRegister.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/queryPage`,
    data
  });
};
export const getPageStaticApi = (data: DepositRegister.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/queryPageCount`,
    data
  });
};
// 导出付款流水EXCEL
export const downWaterExcelApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/downExcel`,
    data
  });
};
// 新增来款
export const addDepositApi = (data: DepositRegister.AddForm) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/add`,
    data
  });
};
// 编辑来款
export const editDepositApi = (data: DepositRegister.AddForm) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/edit`,
    data
  });
};
// 来款日志
export const depositLogApi = (params: { orderNum: string; businessId: string }) => {
  return http({
    method: "get",
    url: `${BusinessType.base}/biz/deposit/getDepositLog`,
    params
  });
};
// 校验excel 数据
export const verifyExcelApi = (data: FormData) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/verifyExcel`,
    data,
    headers: {
      "Content-type": "multipart/form-data"
    }
  });
};
// 导出失败付款流水
export const exportFailDepositApi = (data: { passDepositList: Array<Base.GeneraDataType>; failDepositList: Array<Base.GeneraDataType>; passDepositSummaryList: Array<Base.GeneraDataType> }) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/downExcel`,
    data,
    responseType: "blob"
  });
};
// 导入来款流水
export const importDepositApi = (data: { passDepositList: Array<Base.GeneraDataType>; failDepositList: Array<Base.GeneraDataType>; passDepositSummaryList: Array<Base.GeneraDataType> }) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/importDeposit`,
    data
  });
};
// 审核来款
export const auditDepositApi = (data: WaterVerification.AuditDepositForm) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/edit`,
    data
  });
};
// 删除来款
export const deleteDepositApi = (params: { id: string }) => {
  return http({
    method: "delete",
    url: `${BusinessType.base}/biz/deposit/deleteById`,
    params
  });
};
// 获取来款删除日志
export const getDepositDeleteLogApi = (data: { pageNum: number; pageSize: number; beforePageNum: number }) => {
  return http({
    method: "post",
    url: `${BusinessType.base}/biz/deposit/queryDeleteRecord`,
    data
  });
};
